<?php
//Connection statement
require_once('../Connections/cn.php');

// Load the common classes
require_once('../includes/common/KT_common.php');

// Load the tNG classes
require_once('../includes/tng/tNG.inc.php');

// Make a transaction dispatcher instance
$tNGs = new tNG_dispatcher("../");

// Make an update transaction instance
$upd_persona = new tNG_update($cn);
$tNGs->addTransaction($upd_persona);
// Register triggers
$upd_persona->registerTrigger("STARTER", "Trigger_Default_Starter", 1, "POST", "task");
// Add columns
$upd_persona->setTable("persona");
$upd_persona->addColumn("codigo_ciudad", "NUMERIC_TYPE", "POST", "codigo_ciudad");
$upd_persona->addColumn("nombre_persona", "STRING_TYPE", "POST", "nombre_persona");
$upd_persona->addColumn("paterno_persona", "STRING_TYPE", "POST", "paterno_persona");
$upd_persona->addColumn("materno_persona", "STRING_TYPE", "POST", "materno_persona");
$upd_persona->addColumn("fechanac_persona", "DATE_TYPE", "POST", "fechanac_persona");
$upd_persona->addColumn("direccion_persona", "STRING_TYPE", "POST", "direccion_persona");
$upd_persona->addColumn("email_persona", "STRING_TYPE", "POST", "email_persona");
$upd_persona->addColumn("credencial_persona", "STRING_TYPE", "POST", "credencial_persona");
$upd_persona->setPrimaryKey("rut_persona", "STRING_TYPE", "POST", "rut_persona");

// Execute all the registered transactions
$tNGs->executeTransactions();

// Get the transaction recordset
$rspersona = $tNGs->getRecordset("persona");
$totalRows_rspersona = $rspersona->RecordCount();

//PHP ADODB document - made with PHAkt 3.6.0

if ($tNGs->getErrorMsg()==''){
	echo '1';	
} else {
	echo $tNGs->getErrorMsg();
};



//echo print_r($_POST);
?>